<template>
	<view class="my-repairs">
		<repairs-item v-for="item in repairsList" :key="item.id" :obj='item' @click.native="gotoDetails(item.id)">
		</repairs-item>


		<life-button icon="/static/icon/repair.png" @click="goFillRepairs">在线报修</life-button>
		<view class="box">

		</view>
	</view>
</template>

<script>
	import {
		getMyRepairs
	} from '@/api/repairs.js'
	export default {
		data() {
			return {
				queryObj: {
					current: 1,
					pageSize: 10
				},
				repairsList: []
			}
		},
		onLoad() {
			this.getMyRepairs()
		},
		methods: {
			async getMyRepairs() {
				const res = await getMyRepairs(this.queryObj)
				console.log(res)
				this.repairsList = res.data.rows
			},
			goFillRepairs() {
				uni.navigateTo({
					url: '/pkg-repairs/fillRepairs/fillRepairs'
				})
			},
			gotoDetails(id) {
				uni.navigateTo({
					url: '/pkg-repairs/particulars/particulars?id=' + id
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.my-repairs {
		width: 100%;
		// height: 100%;
		min-height: 1150rpx;
		background: #fafafa;
		padding: 40rpx;
		box-sizing: border-box;

		.box {
			height: 180rpx;
			width: 100%;
			background: #fafafa;
		}
	}
</style>
